cmake_minimum_required(VERSION 3.8)
project(my_lidar_service)

# 默认使用C++17
if(NOT CMAKE_CXX_STANDARD)

  set(CMAKE_CXX_STANDARD 17)
endif()

# 查找依赖包
find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(learning_interface REQUIRED)

# 创建可执行文件
add_executable(livox_service_node src/livox_service_node.cpp)
add_executable(livox_client_node src/livox_client_node.cpp)

# 链接依赖
ament_target_dependencies(livox_service_node
  rclcpp
  sensor_msgs
  learning_interface
)
ament_target_dependencies(livox_client_node
  rclcpp
  sensor_msgs
  learning_interface
)

# 安装目标
install(TARGETS livox_service_node
  DESTINATION lib/${PROJECT_NAME}
)
install(TARGETS livox_client_node
  DESTINATION lib/${PROJECT_NAME}
)

# 导出依赖
ament_export_dependencies(
  rclcpp
  sensor_msgs
  learning_interface
)

ament_package()